// eslint-disable-next-line
import { UserLayout, BasicLayout, BlankLayout } from '@/layouts'

const RouteView = {
  name: 'RouteView',
  render: h => h('router-view')
}
export const asyncRouterMap = [
  {
    path: '/',
    component: BasicLayout,
    redirect: '/yzuperson/yun/index',
    meta: { title: '主页' },
    children: [
      // 足浴
      // {
      //   path: '/dashboard/welcome/Workplace',
      //   name: 'dashboardWorkplace',
      //   component: () => import('@/views/dashboard/yzuwel/Workplace'),
      //   meta: { title: '首页', icon: 'line-chart' }
      // },
      // 云库管理
      {
        path: '/yzuperson',
        name: 'yzuperson',
        component: RouteView,
        meta: { title: '云库管理',icon: 'cloud', userTypeList:['yzuperson1']},
        children: [
          {
            path: '/yzuperson/typemanage/index',
            name: 'typeindex',
            component: () => import('@/views/yzuperson/typemanage/index'),
            meta: { title: '分类管理', userTypeList:['yzupersontype1']}
          },
          {
            path: '/yzuperson/yun/index',
            name: 'yzupersonyun',
            component: () => import('@/views/yzuperson/yun/index'),
            meta: { title: '商品列表', userTypeList:['yzupersonYunIndex1']}
          },
          {
            path: '/yzuperson/getGoods/index',
            name: 'getGoodsIndex',
            component: () => import('@/views/yzuperson/getGoods/index'),
            meta: { title: '采集商品', userTypeList:['yzupersonGetGoods1']}
          },
        ]
      },
      //订单管理
      {
        path: '/yzuorder',
        name: 'yzuorder',
        component: RouteView,
        redirect: '/yzuorder/student/index',
        meta: { title: '订单管理',icon: 'profile', userTypeList:['yzuorder1']},
        children: [
          {
            path: '/yzuorder/statistics/index',
            name: 'statistics',
            component: () => import('@/views/yzuorder/statistics/index'),
            meta: { title: '订单统计', userTypeList:['yzuorderstatisticsindex1']}
          },
          {
            path: '/yzuorder/orderList/index',
            name: 'yzuorderorderList',
            component: () => import('@/views/yzuorder/orderList/index'),
            meta: { title: '订单列表', userTypeList:['yzuorderListIndex1']}
          }
        ]
      },
      // 供应商
      {
        path: '/yzusupplier',
        component: RouteView,
        redirect: '/yzusupplier/supplier/index',
        meta: { title: '供应商管理',icon: 'usergroup-add', userTypeList:['yzusupplier1']},
        children: [
          {
            path: '/yzusupplier/supplier/index',
            name:'yzusupplier',
            component: () => import('@/views/yzusupplier/supplier/index'),
            meta: { title: '供应商列表', userTypeList:['yzusupplierindex1']}
          },
          // {
          //   path: '/yzusupplier/supplier/supplierinfo',
          //   name: 'supplierinfo',
          //   hidden: true,
          //   component: () => import('@/views/yzusupplier/supplier/supplierinfo'),
          //   meta: { title: '业务员对接供应商业绩', userTypeList:['yzusupplier1']}
          // },
        ]
      },
      // 业务员列表
      {
        path: '/yzusalesman',
        name: 'yzusalesman',
        component: RouteView,
        redirect: '/yzusalesman/list/index',
        meta: { title: '业务员管理',icon: 'team', userTypeList:['yzusalesman1']},
        children: [
          {
            path: '/yzusalesman/list/index',
            name: 'yzusalesmanlist',
            component: () => import('@/views/yzusalesman/list/index'),
            meta: { title: '业务员列表', userTypeList:['yzusalesmanlist1']}
          },
          {
            path: '/yzusalesman/commission/index',
            name: 'commissionIndex',
            hidden: true,
            component: () => import('@/views/yzusalesman/commission/index'),
            meta: { title: '佣金查询', userTypeList:['yzusalesmancommission1']}
          }
        ]
      },
      // 商户管理
      {
        path: '/yzumerchant',
        name: 'yzumerchant',
        component: RouteView,
        redirect: '/yzumerchant/merchant/index',
        meta: { title: '商户管理',icon: 'solution', userTypeList:['yzumerchant1']},
        children: [
          {
            path: '/yzumerchant/merchant/index',
            name: 'yzumerchantList',
            component: () => import('@/views/yzumerchant/merchant/index'),
            meta: { title: '商户列表', userTypeList:['yzumerchantIndex1']}
          },
          // {
          //   path: '/yzumerchant/merchant/salesmaninfo',
          //   name: 'salesmaninfo',
          //   hidden: true,
          //   component: () => import('@/views/yzumerchant/merchant/salesmaninfo'),
          //   meta: { title: '业务员对接商户业绩', userTypeList:['yzumerchant1']}
          // },
        ]
      },
      // 系统设置
      {
        path: '/yzusystem',
        name: 'yzusystem',
        component: RouteView,
        redirect: '/yzusystem/users/index',
        meta: { title: '系统设置', icon: 'setting', userTypeList:['system1']},
        children: [
          {
            path: '/yzusystem/users/index',
            name: 'yzusystemUsers',
            component: () => import('@/views/yzusystem/users/index'),
            meta: { title: '用户管理', userTypeList:['systemUser1']}
          },
          {
            path: '/yzusystem/roleList/index',
            name: 'yzusystemrole',
            component: () => import('@/views/yzusystem/roleList/index'),
            meta: { title: '角色管理', userTypeList:['systemRoleList1']}
          },
          {
            path: '/yzusystem/masterInfo/index',
            name: 'yzusystemMasterInfo',
            component: () => import('@/views/yzusystem/masterInfo/index'),
            meta: { title: '主体信息', userTypeList:['masterInfo1']}
          }
        ]
      },
    ]
  },
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import('@/views/user/Login')
      },
      {
        path: 'register',
        name: 'register',
        component: () => import('@/views/user/Register')
      },
      {
        path: 'register-result',
        name: 'registerResult',
        component: () => import('@/views/user/RegisterResult')
      }
    ]
  },
]
